package ExamLab.Test2;

class A implements Runnable{

    public static void doSleep(int y){
         try{
              Thread.sleep(y);
         }catch(Throwable e){
         }
    }

    public synchronized void run(){
         doSleep(500);
         for (int i = 0; i < 5; i++) {
        	 System.out.println(Thread.currentThread().getName() + "--" + i);
		}
         doSleep(500);
    }

}


public class Multi{

    public static void main(String arguments[]){
         Thread rba=new Thread(new Thread(new A()));
         Thread rbb=new Thread(new Thread(new A()));
         rba.start();
         rbb.start();
    }

}